// throttle
export default {
    name: "throttle",
    mounted(el, binding) {
        let delay = binding.arg || 500;
        let timer = null;
        el.addEventListener("click", () => {
            if (timer) {
                clearTimeout(timer);
            }
            timer = setTimeout(() => {
                binding.value();
            }, delay);
        });
    },
};